<template>
<div>
<span v-for="user in users" class="hgclor">
  {{user.data}}--{{user.name}}--{{user.address}}<br>
  <button @click="look">点击绑定</button>
</span>
</div>
</template>

<script>
export default {
  name: "ListView",
  data(){
    return{
      users:[
        {data:'2016-05-02',name:'王小虎',address:'上海市普陀区金沙江路1518弄'},
        {data:'2016-05-04',name:'王小虎',address:'上海市普陀区金沙江路1578弄'},
        {data:'2016-05-01',name:'王小虎',address:'上海市普陀区金沙江路1598弄'},
        {data:'2016-05-03',name:'王小虎',address:'上海市普陀区金沙江路1516弄'},
      ]
    }
  },methods:{
   look(){
     this.users.forEach((u,key)=>{
       if((key+1)%2==1){
         alert(key+1)
       }
     })
   }
  },
}
</script>

<style scoped>
.hgclor:hover{
  background-color: green;
}
</style>